]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspacesView: Small cleanup
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 25 Jun 2020 22:25:22 +0000 (00:25 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 26 Jun 2020 14:19:57 +0000 (16:19 +0200)
scrollToActive() and friends are only used for handling the 'switch-workspace'
animation.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1333

js/ui/workspacesView.js

index 0728d2151cf67f9494da5651ceed42900ac7a47d..a6098cac412a6a1cdcdfa5a771ead3b13a6caef4 100644 (file)
@@ -508,25 +508,11 @@ class WorkspacesDisplay extends St.Widget {
             workspaceManager.get_active_workspace_index();
     }
 
-    _activeWorkspaceChanged(_wm, _from, _to, _direction) {
-        if (this._gestureActive)
-            return;
-
-        this._scrollToActive();
-    }
-
-    _scrollToActive() {
-        let workspaceManager = global.workspace_manager;
-        let active = workspaceManager.get_active_workspace_index();
-
-        this._updateScrollAdjustment(active);
-    }
-
-    _updateScrollAdjustment(index) {
+    _activeWorkspaceChanged(_wm, _from, to, _direction) {
         if (this._gestureActive)
             return;
 
-        this._scrollAdjustment.ease(index, {
+        this._scrollAdjustment.ease(to, {
             mode: Clutter.AnimationMode.EASE_OUT_CUBIC,
             duration: WORKSPACE_SWITCH_TIME,
         });